<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>generate random string on A Place We Can Learn.</title>
    <link>https://blog.cryppy.id/tags/generate-random-string/</link>
    <description>Recent content in generate random string on A Place We Can Learn.</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en</language>
    <lastBuildDate>Sat, 03 Jul 2021 18:51:34 +0800</lastBuildDate><atom:link href="https://blog.cryppy.id/tags/generate-random-string/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Golang - Generate Random String</title>
      <link>https://blog.cryppy.id/article/generate-random-string/</link>
      <pubDate>Sat, 03 Jul 2021 18:51:34 +0800</pubDate>
      
      <guid>https://blog.cryppy.id/article/generate-random-string/</guid>
      <description>Di artikel sebelumnya kita sudah membahas bagaimana cara membuat angka acak di golang, pada dasarnya sama, teorinya pun sama, kita hanya perlu mengganti charset dan yang paling penting adalah parameter dan return value-nya
import ( &amp;#34;math/rand&amp;#34; &amp;#34;time&amp;#34; ) func GenerateRandomString(lengthChar int) string { var charset = &amp;#34;ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijkklmnopqrstuvwxyz&amp;#34; var seededRand *rand.Rand = rand.New(rand.NewSource(time.Now().UnixNano())) b := make([]byte, lengthChar) for i := range b { b[i] = charset[seededRand.Intn(len(charset))] } return string(b) } </description>
    </item>
    
  </channel>
</rss>
