Pracownia.Programowania/helpers/utils.go

19 lines
276 B
Go

package helpers
import (
"crypto/rand"
"fmt"
"github.com/russross/blackfriday"
)
func GenerateId() string {
b := make([]byte, 8)
rand.Read(b)
return fmt.Sprintf("%x", b)
}
func MarkdownToHtml(s string) string {
return string(blackfriday.MarkdownBasic([]byte(s)))
}