Beispiel #1
0
func (id Id) RS() string {
	if !id.CanRead() {
		return ""
	}
	rs := make([]byte, len(id.Pub)+1)
	rs[0] = byte(ROLE_READSTORE)
	copy(rs[1:], id.Pub[:])
	return base58.Encode(rs)
}
Beispiel #2
0
func (id Id) WRS() string {
	if !id.CanWrite() {
		return ""
	}
	wrs := make([]byte, len(id.Priv)+1)
	wrs[0] = byte(ROLE_WRITEREADSTORE)
	copy(wrs[1:], id.Priv[:])
	return base58.Encode(wrs)
}
Beispiel #3
0
func (id Id) S() string {
	s := make([]byte, len(id.Psk)+1)
	s[0] = byte(ROLE_STORE)
	copy(s[1:], id.Psk[:])
	return base58.Encode(s)
}