Completed
Push — master ( ff6124...8caa6f )
by Jan
23s queued 12s
created

src/id3-data.ts   A

Complexity

Total Complexity 1
Complexity/F 1

Size

Lines of Code 13
Function Count 1

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 11
mnd 0
bc 0
fnc 1
dl 0
loc 13
rs 10
bpm 0
cpm 1
noi 0
c 0
b 0
f 0

1 Function

Rating   Name   Duplication   Size   Complexity  
A id3-data.ts ➔ createId3Data 0 10 1
1
import { encodeSize } from "./ID3Util"
2
3
export function createId3Data(frames: Buffer) {
4
    const header = Buffer.alloc(10)
5
    header.fill(0)
6
    header.write("ID3", 0)              // File identifier
7
    header.writeUInt16BE(0x0300, 3)     // Version 2.3.0  --  03 00
8
    header.writeUInt16BE(0x0000, 5)     // Flags 00
9
    encodeSize(frames.length).copy(header, 6)
10
11
    return Buffer.concat([header, frames])
12
}
13