AV <> BV converter for a certain website
Go to file
2020-03-27 11:39:44 +08:00
av.js init 2020-03-23 22:39:56 +08:00
bv.js init 2020-03-23 22:39:56 +08:00
core.js handle negative AVs 2020-03-27 11:39:44 +08:00
index.js init 2020-03-23 22:39:56 +08:00
package.json handle negative AVs 2020-03-27 11:39:44 +08:00
README.md more tests and simplified implementation 2020-03-24 08:23:41 +08:00
test.js handle negative AVs 2020-03-27 11:39:44 +08:00

AV <> BV Converter

An AV <> BV converter adapted from a script on the Internet for a website. Unsupported API, use at your own risk.

Usage

const { avFromBv, bvFromAv, avToBv, bvToAv } = require('avbv')
const Av = require('avbv/av')
const Bv = require('avbv/bv')
avFromBv('BV17x411w7KC') // -> 'av170001'
bvToAv('BV17x411w7KC') // -> 'av170001'
Av.fromBv('BV17x411w7KC') // -> 'av170001'
Bv.toAv('bv17x411w7KC') // -> 'av170001'

bvFromAv('170001') // -> 'BV17x411w7KC'
avToBv('av170001') // -> 'BV17x411w7KC'
Av.toBv(170001) // -> 'BV17x411w7KC'
Bv.fromAv(170001n) // -> 'BV17x411w7KC'

License

WTFPL