package
1.0.0
Repository: https://github.com/byronliang/tools.git
Documentation: pkg.go.dev

# README

位运算配置

BitSet

说明

适用于开关类型的配置,指定位数代表指定配置项,位数长度则代表可配置项的数量;(int8, int32, int64)

特点

  1. 只需存储一个整型位数值,能存储多个配置项

  2. 调用AddBit DelBit 对指定配置项进行更新操作

  3. Exist方法能解析位数值对应的配置项

BitMap

说明

  1. 对整型数字进行转换二进制, 存放位图里, 减小内存占用, 同时能快速检测当前数值是否存在,是否重复。可应用于优惠码校验等

  2. 默认是按照64字节进行映射, 使用哈希值存储位图, 哈希的key=数值 / 64 ; 哈希的值是 数值 % 64

  3. 大量节省内存, 对于大数据数值存储,能减少64倍原内存的占用空间

# Functions

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Variables

No description provided by the author
No description provided by the author

# Structs

No description provided by the author

# Type aliases

No description provided by the author