
Security News
Feross on TBPN: How North Korea Hijacked Axios
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.
@libmedia/asn1
Advanced tools
中文 | English
asn1 是一个 asn1 语法编解码实现,支持 ber、der、per。
npm install @libmedia/asn1
import { defined } from '@libmedia/asn1'
const Syntax = defined.Sequence({
a: defined.Boolean(),
b: defined.Integer(),
c: defined.NumericString(),
d: defined.BMPString(),
e: defined.BitString(),
g: defined.Enumeration({
a: defined.EnumerationValue(0),
b: defined.EnumerationValue(1),
}),
h: defined.ObjectId(),
f: defined.Choice({
a: defined.Tag(defined.Boolean(), 0),
b: defined.Tag(defined.Integer(), 1)
}),
j: defined.Sequence({
a: defined.Boolean(),
b: defined.Integer()
}),
i: defined.Set({
a: defined.Tag(defined.Boolean(), 0),
b: defined.Tag(defined.Integer(), 1)
}),
k: defined.SequenceOf(defined.Sequence({
a: defined.Boolean(),
b: defined.Integer()
})),
n: defined.SetOf(defined.Set({
a: defined.Tag(defined.Boolean(), 0),
b: defined.Tag(defined.Integer(), 1)
})),
m: defined.SequenceExt({
a: defined.Boolean(),
b: defined.Integer()
}, {
c: defined.BMPString()
}),
q: defined.Null()
})
import { BerEncoder } from '@libmedia/asn1'
const encoder = new BerEncoder()
const buffer = encoder.encode({
a: true,
b: 1,
c: '123',
d: '哈',
e: '101',
g: 1,
h: '1.2.840.113549',
f: {
b: 3
},
j: {
a: false,
b: 4
},
i: {
a: false,
b: 6
},
k: [{
a: true,
b: 6
}],
n: [{
a: true,
b: 7
}],
m: {
a: true,
b: 8,
c: '^_^'
},
q: null
}, Syntax)
import { BerDecoder } from '@libmedia/asn1'
const decoder = new BerDecoder()
const result = decoder.decode(buffer, Syntax)
你可以使用命令行工具将 asn 语法定义文件快速转换成使用 defined 定义的 ts 文件。
# 全局安装
asn1ts -i ./xxx.asn -o ./xxx.ts
# 本地安装
npx asn1ts -i ./xxx.asn -o ./xxx.ts
FAQs
asn1 encoder and decoder
We found that @libmedia/asn1 demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.

Security News
OpenSSF has issued a high-severity advisory warning open source developers of an active Slack-based campaign using impersonation to deliver malware.

Research
/Security News
Malicious packages published to npm, PyPI, Go Modules, crates.io, and Packagist impersonate developer tooling to fetch staged malware, steal credentials and wallets, and enable remote access.