原创 一個簡單卻是實用的分佈式ID解決方案light-id

https://github.com/dubby1994/light-id 動機 希望可以有一個容易部署,容易維護,原理簡單(意味着不容易出問題),且性能還不錯的分佈式ID解決方案,沒錯,是方案,而不是方法。 ID組成 si

原创 常用加密解密(3)——非對稱加密

原文鏈接:https://www.dubby.cn/detail.html?id=9124 最常用的非對稱加密算法應該就是RSA,而且非對稱加密算法的實現比較複雜,所以這裏只介紹RSA。 密鑰長度 密鑰默認長度 工作模式 填充方

原创 常用加密解密(4)——數字簽名

原文鏈接:https://www.dubby.cn/detail.html?id=9125 之前介紹了《常用加密解密(1)》裏面提到了消息摘要,那麼這一篇的數字簽名和消息摘要有什麼區別呢?事實上數字簽名就是帶上非對稱加密的消息摘要。

原创 自己動手寫一個Redis客戶端

原文鏈接:https://www.dubby.cn/detail.html?id=9121 使用JavaFX,不依賴任何其他依賴,實現的一個簡單的Redis客戶端,編寫的初衷是覺得Redis Desktop Manager太難用,並

原创 常用加密解密(1)——消息摘要

原文鏈接:https://www.dubby.cn/detail.html?id=9122 文章目錄1. 常見編碼1.1 Hex1.2 Base641.3 Base322. 消息摘要2.1 MD52.2 SHA2.3 MAC 1. 常

原创 常用加密解密(2)——對稱加密

原文鏈接:https://www.dubby.cn/detail.html?id=9123 文章目錄AESDESDESedeIDEA 本文主要介紹常用的對稱加密算法的Java實現 <dependency> <groupId

原创 Redis刪除大Key

原文鏈接:https://www.dubby.cn/detail.html?id=9112 這裏說的大key是指包含很多元素的set,sorted set,list和hash。 刪除操作,我們一般想到有2種,del和expire。

原创 Web Socket 性能對比——Spring Boot vs Tomcat vs Netty

原文鏈接:https://www.dubby.cn/detail.html?id=9106 統計結果精確到5位小數;每次請求都預熱過了 等待上一個消息響應後再發送下一個消息 實現方式 消息類型 消息長度 發送消息數 總耗時(

原创 【淺度渣文】Jackson之jackson-annotations

原文鏈接:http://www.dubby.cn/detail.html?id=9071 字段命名 @JsonProperty可以指定字段的命名(還可以指定這個字段需要參與序列化和反序列化)。 @JsonProperty.valu

原创 【淺度渣文】Jackson之jackson-databind

原文鏈接:http://www.dubby.cn/detail.html?id=9070 前幾篇介紹Jackson的文章(Jackson介紹,Jackson之jackson-core),雖然很好,但是我相信你並願意在項目中使用,因爲

原创 Go實現對MySQL的增刪改查

原文鏈接:https://www.dubby.cn/detail.html?id=9113 依賴 先下載go-sql-driver/mysql: go get -u github.com/go-sql-driver/mysql 數據

原创 Lettuce和Jedis的基準測試

原文鏈接:https://www.dubby.cn/detail.html?id=9108 1.準備工作 本地需要安裝Redis,使用JMH做基準測試的框架: <dependency> <groupId>org.openjdk

原创 實現登錄態的幾種方式

原文鏈接:https://www.dubby.cn/detail.html?id=9109 隨着服務化的普及,直接維護session的越來越困難,現在一般來說都會使用一個token來表示用戶的登錄狀態,用來標識這個用戶的身份,這就是登

原创 Netty實現Web Socket

原文鏈接:https://www.dubby.cn/detail.html?id=9104 獲取代碼 https://github.com/dubby1994/netty-study/tree/master 1.依賴 <depend

原创 WebSocket的Frame協議解析

原文鏈接:https://www.dubby.cn/detail.html?id=9105 先給出WebSocket Frame的協議: 複製抓包抓到的數據: 81 85 30 6c e2 9a 54 19 80 f8 49 字段