Reduce wireSalt allocation in HashName
This commit is contained in:
parent
2f8cf50b32
commit
c2889aea81
3
nsecx.go
3
nsecx.go
|
@ -2,13 +2,14 @@ package dns
|
|||
|
||||
import (
|
||||
"crypto/sha1"
|
||||
"encoding/hex"
|
||||
"hash"
|
||||
"strings"
|
||||
)
|
||||
|
||||
// HashName hashes a string (label) according to RFC 5155. It returns the hashed string in uppercase.
|
||||
func HashName(label string, ha uint8, iter uint16, salt string) string {
|
||||
wireSalt := make([]byte, DefaultMsgSize)
|
||||
wireSalt := make([]byte, hex.DecodedLen(len(salt)))
|
||||
n, err := packStringHex(salt, wireSalt, 0)
|
||||
if err != nil {
|
||||
return ""
|
||||
|
|
Loading…
Reference in New Issue