class Pwgen::Sha1Source

Overview

Provides deterministic pseudo-random number generation using SHA1.

This class implements a PRNG by repeatedly hashing a file's content with an incrementing seed. Useful for generating reproducible passwords.

Defined in:

pwgen/sha1_source.cr

Constant Summary

BUFFER_SIZE = 20
DEFAULT_SEED = "pwgen"

Constructors

Instance Method Summary

Constructor Detail

def self.new(spec : String) #

[View source]

Instance Method Detail

def next_number(max : Int32) : Int32 #

[View source]
def to_proc : NumberProc #

[View source]