UNPKG

ts-mls

Version:

[![CI](https://github.com/LukaJCB/ts-mls/actions/workflows/ci.yml/badge.svg)](https://github.com/LukaJCB/ts-mls/actions/workflows/ci.yml) [![npm version](https://badge.fury.io/js/ts-mls.svg)](https://badge.fury.io/js/ts-mls) [![Coverage Status](https://co

11 lines 484 B
import { composeBufferEncoders, encode } from "../codec/tlsEncoder.js"; import { varLenDataEncoder } from "../codec/variableLength.js"; export function refhash(label, value, h) { return h.digest(encodeRefHash(label, value)); } function encodeRefHash(label, value) { const labelBytes = new TextEncoder().encode(label); const enc = composeBufferEncoders([varLenDataEncoder, varLenDataEncoder]); return encode(enc)([labelBytes, value]); } //# sourceMappingURL=hash.js.map