summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorsiddharth <s@ricketyspace.net>2021-09-04 19:00:26 -0400
committersiddharth <s@ricketyspace.net>2021-09-04 19:00:26 -0400
commita8901ea04d835a32fdbcee8e4acc0f884a3f6782 (patch)
tree08d720f59ec794e651b261346317fa367ab9f1f4 /lib
parent3bbee6720b9fca81817289fe0e1fe830476cf600 (diff)
lib: MTPasswordResetToken -> MTToken
Diffstat (limited to 'lib')
-rw-r--r--lib/rng.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/rng.go b/lib/rng.go
index c48f719..f16aeae 100644
--- a/lib/rng.go
+++ b/lib/rng.go
@@ -143,7 +143,9 @@ func MTXORStream(stream, seed []byte) []byte {
return s
}
-func MTPasswordResetToken(seed uint32, length int) string {
+// Returns a "random" token of length `length` using MT19937 seeded
+// with `seed`. The returned token is a hex string.
+func MTToken(seed uint32, length int) string {
if length < 16 {
length = 16 // Default length.
}