refactor(backend): replace private-ip with ipaddr.js (#11041)

* refactor(backend): replace private-ip with ipaddr.js

* restore ip-cidr
This commit is contained in:
Kagami Sascha Rosylight
2023-06-24 23:35:09 +02:00
committed by GitHub
parent 5d922e3084
commit a2c0573f84
4 changed files with 17 additions and 36 deletions

View File

@@ -1,6 +1,6 @@
import IPCIDR from 'ip-cidr';
export function getIpHash(ip: string) {
export function getIpHash(ip: string): string {
try {
// because a single person may control many IPv6 addresses,
// only a /64 subnet prefix of any IP will be taken into account.