(name, _maxLength)
| 71 | * as the wildcard resolution. |
| 72 | */ |
| 73 | export function dnsEncode(name, _maxLength) { |
| 74 | const length = (_maxLength != null) ? _maxLength : 63; |
| 75 | assertArgument(length <= 255, "DNS encoded label cannot exceed 255", "length", length); |
| 76 | return hexlify(concat(ensNameSplit(name).map((comp) => { |
| 77 | assertArgument(comp.length <= length, `label ${JSON.stringify(name)} exceeds ${length} bytes`, "name", name); |
| 78 | const bytes = new Uint8Array(comp.length + 1); |
| 79 | bytes.set(comp, 1); |
| 80 | bytes[0] = bytes.length - 1; |
| 81 | return bytes; |
| 82 | }))) + "00"; |
| 83 | } |
| 84 | //# sourceMappingURL=namehash.js.map |
no test coverage detected