/**
 * Copyright (c) 2018-present, heineiuo.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */ import Slice from './Slice' ; export enum RecordType { kZeroType = 0 , kFullType = 1 , kFirstType = 2 , kMiddleType = 3 , kLastType = 4 } export function createHexStringFromDecimal ( decimal ) { let str = decimal . toString ( 16 ) ; while ( str . length < 4 ) { str = `0${ str }` ; } return str ; } export interface Record { length : number ; type : number ; data : Slice ; } export const kMaxRecordType = RecordType . kLastType ; export const kBlockSize = 32768 ; export const kHeaderSize = 4 + 2 + 1 ;