tape: Add StringTag

This commit is contained in:
Sasha Koshka 2025-07-10 21:56:38 -04:00
parent 5a3296a842
commit 2305814e10

View File

@ -54,6 +54,11 @@ func BufferTag(value []byte) Tag {
return bufferLenTag(len(value))
}
// StringTag returns the appropriate tag for a string.
func StringTag(value string) Tag {
return bufferLenTag(len(value))
}
func bufferLenTag(length int) Tag {
if length < int(CNLimit) {
return SBA.WithCN(length)