Initial commit

This commit is contained in:
Ivan 2025-06-11 00:24:24 +05:00
commit f2788efb82
Signed by: landlord
GPG key ID: 416A03BC4ADA4CD7
9 changed files with 954 additions and 0 deletions

19
token_test.go Normal file
View file

@ -0,0 +1,19 @@
package csrf
import (
"testing"
)
func TestTokenGeneration(t *testing.T) {
var tokenLength uint = 8
token, err := generateCSRFToken(tokenLength)
if err != nil {
t.Error(err)
}
actualTokenLength := uint(len(token))
if actualTokenLength != tokenLength {
t.Errorf("incorrect token length: %d", actualTokenLength)
}
}