这个号码编码叫什么?

时间:2017-01-29 13:25:07

标签: encoding variable-length

我知道一些可变长度的数字编码 它分享了1s线性编码有效载荷长度的核心思想。

0
10x
110xx
1110xxx

或1s和Xs交错:

0
1x0
1x1x0
1x1x1x0

经过一些微小的修改(每1个7 X,最后7个X),我们得到:

0xxxxxxx
1xxxxxxx0xxxxxxx
1xxxxxxx1xxxxxxx0xxxxxxx
1xxxxxxx1xxxxxxx1xxxxxxx0xxxxxxx

https://en.wikipedia.org/wiki/Variable-length_quantity

或:

0xxxxxxx
110xxxxx 10xxxxxx
1110xxxx 10xxxxxx 10xxxxxx
11110xxx 10xxxxxx 10xxxxxx 10xxxxxx

https://de.wikipedia.org/wiki/UTF-8

但它们都是线性扩展的。 我想要一些指数级的东西 可以在前向方向按位解码 (无需字节对齐,反向解码或随机搜索) 所以我想出了:

0
1x0
1x1xx0
1x1xx1xxxx0
1x1xx1xxxx1xxxxxxxx0

有人知道这是什么东西,它叫什么?

1 个答案:

答案 0 :(得分:0)

这种编码用于UTF-8。它被称为Variable-width encoding