aboutsummaryrefslogtreecommitdiffstats
path: root/client/go/internal/util/md5.go
blob: 6a98b49c472b404855a00c6ace7dbb0ce21fdf06 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
// Author: arnej

package util

import (
	"crypto/md5"
	"fmt"
	"io"
)

func Md5Hex(text string) string {
	hasher := md5.New()
	io.WriteString(hasher, text)
	hash := hasher.Sum(nil)
	return fmt.Sprintf("%x", hash)
}