Skip to content

Commit

Permalink
Added DICOM type to archive
Browse files Browse the repository at this point in the history
  • Loading branch information
Linards Losans committed Feb 9, 2019
1 parent 0c75167 commit 1a17848
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions matchers/archive.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ var (
TypeLz = newType("lz", "application/x-lzip")
TypeRpm = newType("rpm", "application/x-rpm")
TypeElf = newType("elf", "application/x-executable")
TypeDcm = newType("dcm", "application/dicom")
)

var Archive = Map{
Expand Down Expand Up @@ -52,6 +53,7 @@ var Archive = Map{
TypeLz: Lz,
TypeRpm: Rpm,
TypeElf: Elf,
TypeDcm: Dcm,
}

func Epub(buf []byte) bool {
Expand Down Expand Up @@ -215,3 +217,9 @@ func Elf(buf []byte) bool {
buf[0] == 0x7F && buf[1] == 0x45 &&
buf[2] == 0x4C && buf[3] == 0x46
}

func Dcm(buf []byte) bool {
return len(buf) > 131 &&
buf[128] == 0x44 && buf[129] == 0x49 &&
buf[130] == 0x43 && buf[131] == 0x4D
}

0 comments on commit 1a17848

Please sign in to comment.