ParseDByte parses a string representation of hex encoded binary data. It supports both the hex format, with "\x" followed by a string of hexadecimal digits (the "\x" prefix occurs just once at the beginning), and the escaped format, which supports "\\" and octal escapes.
(s string)
| 368 | // the beginning), and the escaped format, which supports "\\" and |
| 369 | // octal escapes. |
| 370 | func ParseDByte(s string) (*DBytes, error) { |
| 371 | res, err := lex.DecodeRawBytesToByteArrayAuto(encoding.UnsafeConvertStringToBytes(s)) |
| 372 | if err != nil { |
| 373 | return nil, MakeParseError(s, types.Bytes, err) |
| 374 | } |
| 375 | return NewDBytes(DBytes(encoding.UnsafeConvertBytesToString(res))), nil |
| 376 | } |
| 377 | |
| 378 | // ParseDUuidFromString parses and returns the *DUuid Datum value represented |
| 379 | // by the provided input string, or an error. |
no test coverage detected
searching dependent graphs…