github.com/keybase/client/go@v0.0.0-20240309051027-028f7c731f8b/kbfs/tlf/test_common.go (about)

     1  // Copyright 2016 Keybase Inc. All rights reserved.
     2  // Use of this source code is governed by a BSD
     3  // license that can be found in the LICENSE file.
     4  
     5  package tlf
     6  
     7  // FakeID creates a fake public or private TLF ID from the given
     8  // byte.
     9  func FakeID(b byte, t Type) ID {
    10  	bytes := [idByteLen]byte{b}
    11  	switch t {
    12  	case Public:
    13  		bytes[idByteLen-1] = pubIDSuffix
    14  	case Private:
    15  		bytes[idByteLen-1] = idSuffix
    16  	case SingleTeam:
    17  		bytes[idByteLen-1] = singleTeamIDSuffix
    18  	}
    19  	return ID{bytes}
    20  }
    21  
    22  // FakeIDByte returns the byte used to create a fake TLF ID with
    23  // FakeID.
    24  func FakeIDByte(id ID) byte {
    25  	return id.id[0]
    26  }