bvconv

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 15, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package bvconv converts between Bilibili's BV and AV video identifiers.

BVID is the canonical encoded form (for example BV1GJ411x7h7); AVID is the legacy numeric form (for example av170001). The two are losslessly interconvertible with two positional swaps, a base58 alphabet, an XOR mask, and a 51-bit modulus. This mirrors the current published algorithm.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ToAV

func ToAV(bvid string) (int64, error)

ToAV converts a BVID to its numeric AVID. The bvid must be the 12-character form, with or without the "BV" prefix casing.

func ToBV

func ToBV(aid int64) string

ToBV converts a numeric AVID to its 12-character BVID (with the BV1 prefix).

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL