Source File
nonce.go
Belonging Package
mellium.im/sasl
// Copyright 2016 The Mellium Contributors.// Use of this source code is governed by the BSD 2-clause license that can be// found in the LICENSE file.package saslimport ()// Generates a nonce with n random bytes base64 encoded to ensure that it meets// the criteria for inclusion in a SCRAM message.func ( int, io.Reader) []byte {if < 1 {panic("Cannot generate zero or negative length nonce")}:= make([]byte, ), := .Read()switch {case != nil:panic()case != :panic("Could not read enough randomness to generate nonce")}:= make([]byte, base64.RawStdEncoding.EncodedLen())base64.RawStdEncoding.Encode(, )return}
![]() |
The pages are generated with Golds v0.3.6. (GOOS=darwin GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds. |