StringBytes writes the result of String directly into a buffer, which must have a length of at least 36.
(buf []byte)
| 143 | // StringBytes writes the result of String directly into a buffer, which must |
| 144 | // have a length of at least 36. |
| 145 | func (u UUID) StringBytes(buf []byte) { |
| 146 | _ = buf[:36] |
| 147 | hex.Encode(buf[0:8], u[0:4]) |
| 148 | buf[8] = '-' |
| 149 | hex.Encode(buf[9:13], u[4:6]) |
| 150 | buf[13] = '-' |
| 151 | hex.Encode(buf[14:18], u[6:8]) |
| 152 | buf[18] = '-' |
| 153 | hex.Encode(buf[19:23], u[8:10]) |
| 154 | buf[23] = '-' |
| 155 | hex.Encode(buf[24:], u[10:]) |
| 156 | } |
| 157 | |
| 158 | // SetVersion sets the version bits. |
| 159 | func (u *UUID) SetVersion(v byte) { |