zoukankan
html css js c++ java
Java Net版短网址(ShortUrl)的算法及实现 待续
算法
1)将长网址md5生成32位签名串,分为4段, 每段8个
字节
;
2)对这四段循环处理, 取8个
字节
, 将他看成16进制串与0x3fffffff(30位1)与操作, 即超过30位的忽略处理;
3)这30位分成6段, 每5位的数字作为字母表的索引取得特定
字符
, 依次进行获得6位字符串;
4)总的md5串可以获得4个6位串; 取里面的任意一个就可作为这个长url的短url地址;
待续
查看全文
相关阅读:
三个问题
2014-7
2014-5
2014-2
2014-1
2013-11
mysql中对表操作----为所有列插入数据
Redis做消息队列
收集Nginx-access,Nginx-error日志
.Nginx安装filebeat收集日志:
原文地址:https://www.cnblogs.com/happyday56/p/4137705.html
最新文章
HDU 4749 Parade Show(贪心+kmp)
HDU 4750 Count The Pairs(并查集)
HDU 4751 Divide Groups
CF 55D. Beautiful numbers(数位DP)
python学习之路day2
python学习之路day1
远程工具
Docker Day 2 Docker容器管理
Docker Day 1 Docker基础之常用操作指令
python 脚本实现定时重启Linux 系统
热门文章
ubuntu16.04 安装sublime开发工具
python 脚本 提取指定时间内的文件到新目录
shell,sed ,写入文件,追加内容,修改内容
shell 快注释
解决安装DEB包时报错
显示器与监控的切换
求助:对话框下OnInitDialog中使用SetTimer无效
MFC之MessageBox用法
UML基础:统一建模语言简介
一个铜钱的故事
Copyright © 2011-2022 走看看