aes70
Version:
A controller library for the AES70 protocol.
16 lines (14 loc) • 373 B
JavaScript
import { createType } from './createType.js';
export const OcaUint16 = createType({
isConstantLength: true,
encodedLength: function (value) {
return 2;
},
encodeTo: function (dataView, pos, value) {
dataView.setUint16(pos, 0 | value, false);
return pos + 2;
},
decode: function (dataView, pos) {
return dataView.getUint16(pos, false);
},
});