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)
| 217 | // the beginning), and the escaped format, which supports "\\" and |
| 218 | // octal escapes. |
| 219 | func ParseDByte(s string) (*DBytes, error) { |
| 220 | res, err := lex.DecodeRawBytesToByteArrayAuto([]byte(s)) |
| 221 | if err != nil { |
| 222 | return nil, makeParseError(s, types.Bytes, err) |
| 223 | } |
| 224 | return NewDBytes(DBytes(res)), nil |
| 225 | } |
| 226 | |
| 227 | // ParseDUuidFromString parses and returns the *DUuid Datum value represented |
| 228 | // by the provided input string, or an error. |
no test coverage detected