22 lines
291 B
Go
22 lines
291 B
Go
|
// Rrea
|
||
|
|
||
|
package main
|
||
|
|
||
|
import (
|
||
|
"fmt"
|
||
|
"log"
|
||
|
"os"
|
||
|
|
||
|
"smariot.com/complexity"
|
||
|
)
|
||
|
|
||
|
func main() {
|
||
|
entropy, count, err := complexity.Reader(os.Stdin)
|
||
|
|
||
|
fmt.Printf("read %d runes, entropy=%fb, average=%fb/rune\n", count, entropy, entropy/float32(count))
|
||
|
|
||
|
if err != nil {
|
||
|
log.Fatal(err)
|
||
|
}
|
||
|
}
|