UNPKG

@node-dlc/wire

Version:
11 lines (9 loc) 274 B
import { Base32 } from '@node-dlc/common'; /** * Converts a Tor address in string notation into a Buffer */ export function torStringToBuffer(host: string): Buffer { host = host.substr(0, host.indexOf('.')); host = host.toUpperCase(); return Base32.decode(host); }