github.com/Finschia/finschia-sdk@v0.48.1/x/token/class/keeper/keys.go (about)

     1  package keeper
     2  
     3  var (
     4  	nonceKey    = []byte{0x01}
     5  	idKeyPrefix = []byte{0x02}
     6  )
     7  
     8  func idKey(id string) []byte {
     9  	key := make([]byte, len(idKeyPrefix)+len(id))
    10  	copy(key, idKeyPrefix)
    11  	copy(key[len(idKeyPrefix):], id)
    12  	return key
    13  }
    14  
    15  func splitIDKey(key []byte) (id string) {
    16  	return string(key[len(idKeyPrefix):])
    17  }