Baike.dev
All toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
D

dongle

> 编程语言
Open source

A simple, semantic and developer-friendly crypto package for golang

1.1K stars0 likes0 views
WebsiteGitHub

About

A simple, semantic and developer-friendly crypto package for golang

English | 简体中文 | 日本語

Introduction

Dongle is a simple, semantic and developer-friendly golang crypto package with 100% unit test coverage,has been included by awesome-go, and has won the gitee 2024 Most Valuable Project (GVP) and gitcode 2024 Open Source Star Project (G-Star) awards

Repository

github.com/dromara/dongle

gitee.com/dromara/dongle

gitcode.com/dromara/dongle

Quick Start

Installation

go version >= 1.23

// Via github 
go get -u github.com/dromara/dongle

// Via gitee
go get -u gitee.com/dromara/dongle

// Via gitcode 
go get -u gitcode.com/dromara/dongle

Dongle was donated to the dromara organization, the repository URL has changed. If the previous repository used was golang-module/dongle, please replace the original repository with the new repository in go.mod, or execute the following command:

go mod edit -replace github.com/golang-module/dongle = github.com/dromara/dongle

Example Usage

Encode&Decode(using Base64 as an example)

import (
    "github.com/dromara/dongle"
)

dongle.Encode.FromString("hello world").ByBase64().ToString()      // aGVsbG8gd29ybGQ=
dongle.Decode.FromString("aGVsbG8gd29ybGQ=").ByBase64().ToString() // hello world

Hash Algorithm(using Md5 as an example)

import (
    "github.com/dromara/dongle"
)

dongle.Hash.FromString("hello world").ByMd5().ToHexString()    // 5eb63bbbe01eeed093cb22bb8f5acdc3
dongle.Hash.FromString("hello world").ByMd5().ToBase64String() // XrY7u+Ae7tCTyyK7j1rNww==

Hmac Algorithm(using Md5 as an example)

import (
    "github.com/dromara/dongle"
)

dongle.Hash.FromString("hello world").WithKey([]byte("dongle")).ByMd5().ToHexString()    // 4790626a275f776956386e5a3ea7b726
dongle.Hash.FromString("hello world").WithKey([]byte("dongle")).ByMd5().ToBase64String() // R5Biaidfd2lWOG5aPqe3Jg==

Symmetric Encryption&Decryption(using AES as an example)

…

Asymmetric Encryption&Decryption(using RSA as an example)

…

Digital Signature&Verification(using RSA as an example)

…

For more usage examples, please refer to official document, and visit Playground for online tools.

Contributors

Thanks to all the following who contributed to dongle:

Sponsors

Dongle is a non-commercial open source project. If you want to support dongle, you can buy a cup of coffee for developer.

Thanks

Dongle has obtained a free JetBrains open source license, and we would like to express our thanks here.

License

Dongle is licensed under the MIT License, see the LICENSE file for details.

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Go3desaesbase100base16

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言