How to use fungsi md5 in golang

yourbasic.org/golang

To compute the hash value of a string or byte slice, use the Sum function from a crypto package such as crypto/md5, crypto/sha1, or crypto/sha256.

s := "Foo" md5 := md5.Sum([]byte(s)) sha1 := sha1.Sum([]byte(s)) sha256 := sha256.Sum256([]byte(s)) fmt.Printf("%x\n", md5) fmt.Printf("%x\n", sha1) fmt.Printf("%x\n", sha256) 1356c67d7ad1638d816bfb822dd2c25d 201a6b3053cc1422d2c3670b62616221d2290929 1cbec737f863e4922cee63cc2ebbfaafcd1cff8b790d8cfd2e6a5d550b648afa

File checksum

To compute the hash value of a file or other input stream:

input := strings.NewReader("Foo") hash := sha256.New() if _, err := io.Copy(hash, input); err != nil { log.Fatal(err) } sum := hash.Sum(nil) fmt.Printf("%x\n", sum) 1cbec737f863e4922cee63cc2ebbfaafcd1cff8b790d8cfd2e6a5d550b648afa

More code examples

Go blueprints: code for com­mon tasks is a collection of handy code examples.

Share this page:  

      
   

Go string handling overview [cheat sheet]

40+ essential string functions: literals, concatenation, equality, ordering, indexing, UTF-8, search, join, replace, split, trim, strip, lowercase/uppercase.

yourbasic.org

How to use the io.Writer interface

An io.Writer is an entity to which you can write a stream of bytes. The standard library contains many Writers, and Writers are accepted as input by many utilities.

yourbasic.org

  • Algorithms to Go

See all 178 Go articles

Saraswathi Veena (Saraswati Veena)

The veena is the most ancient stringed instrument of India. It is one of the three principal musical instruments mentioned in the vedic literature, the other two being the venu (flute) and Mrindanga. Veena is considered to be a divine instrument and in Hindu mythology,Gods and Goddesses are often depicted as playing on the veena and enjoying its sweet melodies. The great acharya, Sankara Bhagavadpada describes Devi Meenakshi as Veena venu mridanga vadyarasikam in Meenakshi Pancharatnam. The descriptions of the Divine Mother by the eminent poet Kalidasa are often as playing veena (Manikya veenamupalalayantim in Syamala Dandakam, Veena sankrantahastam in Navaratna malika stotram etc).

Veena is known from time immemorial, although the descriptions in the vedic literature tend to suggest veena of a different design than the present day ones. Also, vedic literature describes several different forms of veena. A careful examination of the description of vedic rites drives us to the conclusion that the origin of Indian music lay in certain rites where the priest and the performer chant some gathas alternately while the wife (Yajamani) plays on the veena. Mention of veena can often be found in various brahmanas and sutras. For example, Aitreya Brahmana describes two different types of veena, the daivi and manushi veenas. Similarly, Naradi Siksha mentions about the daravi and gatra veenas. It is interesting to note that veenas with various numbers of strings, starting with the ekatantri (single string) veena to one with one hundred strings are mentioned in vedic texts.

The great epics, Ramayana and Mahabharata also speak of veena. In Ramayana we find mention of the Vipanchi veena with nine strings. Veena is referred to as laya and tantri in some places of the epic. Valmiki after composing the Ramayana declares “this historical poem, which is pleasant to sing and adapted to the three measurements of time, is contained within the seven notes and can be sung to the veena”. In fact, the princess Lava and Kusa are said to have used the Ekatantri veena in the Ramayana Gana in Lord Rama’s court.

The sanskrit treatises on music describe veena in great detail. Bharata in his Natyasastra talks of the chitra veena as having seven strings and vipanchi veena as having nine strings (saptatrantri bhavechchitra vipanchi navatantrika). Bharata also makes mention of the veenas, kachchapi, ghosaka etc. Narada in Sangita Makaranda mentions a variety of veenas like kachchapi, kubjika, chitra, parivadini, jaya, ghosavati, jyeshta, nakuli, mahati, vaishnavi, brahmi, raudri, ravani, sarasvati, kinnari, saurandri, ghosaka etc. Sarangadeva mentions two main types of veena, the sruti and swara. He also describes elaborately the construction and playing of different kinds of veena. Pandit Ramamatya in the third chapter of his treatise, Swaramelakalanidhi, describes the construction of veenas and divides veenas into three main heads, the sudhdha mela veena, madhya mela veena and achyuta rajendra mela veena.

The word veena nowadays has come to mean the Sarasvati veena, the most important instrument of the Carnatic music sphere. Veena produces all the gamakas or graces of Indian Music. Both the Lakshya and Lakshana forms of music are possible in veena playing. The epitome of veena playing is the Tanam, and veena has few equals in this particular forte. Listening to tanam playing on veena is a unique experience. Further, the presence of frets enables the production of music of highest purity, even in high-speed brigas, which can be achieved by sincere and dedicated practice.

For centuries over, veena is considered as a divine instrument and playing veena is considered to be a yoga. Yagjavalkya Maharishi observed that:

वीणा वादन तत्वज्ञः श्रुतिर्जाति विशारदः

ताल ज्ननस्च प्रयासेन मोक्षमार्गं स गच्छति

Veena vadana tatvagjnah Srutijaati Visarathah |

Talagjascha$prayatnena mokshamargam sa gachchati ||

(In short, it means, salvation or liberation can be attained effortlessly by playing veena).

Maharishi has chosen the word “aprayatnena” (effortlessly) since the usual yogas prescribed by the vedas for liberation require lot of mental and physical efforts. Sarangadeva has beautifully elaborated the divinity of veena as:

Darsana sparsane chasya bhoga svargapavargade |

Punito viprahatyadi patakaih patitam janam ||

Danda sambhuruma tantri kakubhah kamalapatih |

Indra patrika brahma tumbam nabhih sarasvati ||

Dorako vasukirjiva sudhamsuh sarika ravih |

Sarvadevamayi tasmad veeneyam sarvamangala ||

(That is, by seeing and touching the veena, one attains the sacred religion and liberation. It purifies the sinner, who is been guilty of killing a Brahmin. The danda, made of wood or Bamboo, is Siva, the string is Devi Uma, the shoulder is Vishnu, the bridge is Lakshmi, the gourd is Brahma, the navel is Sarasvati, the connecting wires are vasuki, the jiva is the moon and the pegs are the sun. The veena thus represents nearly all the Gods and Goddesses, and is, therefore, capable of bestowing all kinds of divine blessings, benediction and auspiciousness).

The music world has always kept the highest regard for the veena music. Sri Muthuswami Dikshitar was a veena player par excellence; hence the sangatis and phrases in his songs are coloured with gamakas characteristic of Indian music. He proudly stamps his signature as “Vainika Gayaka Guruguha” in the Bhairavi song Balagopala. He addresses Raja Matangi, a form of Divine Mother depicted as playing veena, as Veena gana dasagamakakriye in his immortal song Meenakshi me mudam. Saint Tyagaraja observes in the song Mokshamu Galata that people know not the secret of Lord Siva deriving immeasurable pleasure from the music of veena. It may further be noted that the first part of the charanam of this song describes implicitly the vocal music and the second part talks of veena music. It perhaps testifies the intimate association of veena music with vocal music. At this juncture, it may well be noted that the renowned musicologist, Prof. Sambamoorthy suggested that singing along with veena improves the quality of the voice.

In conclusion, veena playing is an yoga by itself, which can bestow happiness both in mundane as well as supramundane lives. Rishis of the yore to musicians of the day have engrossed themselves in the divine music of veena and have looked upon the veena practice as means to an end.

Ini adalah bagaimana saya mulai mendapatkan md5 hash dari string:

Tapi jelas ini bukan cara kerjanya. Seseorang bisa memberikan saya contoh untuk ini?

Pemrograman

This is how I started to get a md5 hash from a string:

import "crypto/md5" var original = "my string comes here" var hash = md5.New(original)

But obviously this is not how it works. Can someone provide me a working sample for this?

1

Video yang berhubungan

Postingan terbaru

LIHAT SEMUA