Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 5 of 5 for UInt64 (0.4 sec)

  1. docs/debugging/hash-set/main.go

    	if cardinality <= 0 {
    		return -1
    	}
    	// use the faster version as per siphash docs
    	// https://github.com/dchest/siphash#usage
    	k0, k1 := binary.LittleEndian.Uint64(id[0:8]), binary.LittleEndian.Uint64(id[8:16])
    	sum64 := siphash.Hash(k0, k1, []byte(key))
    	return int(sum64 % uint64(cardinality))
    }
    
    // hashOrder - hashes input key to return consistent
    // hashed integer slice. Returned integer order is salted
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Mon Sep 19 18:05:16 GMT 2022
    - 3.7K bytes
    - Viewed (0)
  2. docs/debugging/xattr/main.go

    var (
    	path, name string
    	value      uint64
    	set, list  bool
    )
    
    func getxattr(path, name string) (uint64, error) {
    	buf, err := xattr.LGet(path, name)
    	if err != nil {
    		return 0, err
    	}
    
    	return binary.LittleEndian.Uint64(buf[:8]), nil
    }
    
    func listxattr(path string) ([]string, error) {
    	return xattr.LList(path)
    }
    
    func setxattr(path, name string, value uint64) error {
    	data := make([]byte, 8)
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Fri Dec 29 23:52:41 GMT 2023
    - 3.2K bytes
    - Viewed (0)
  3. docs/debugging/reorder-disks/main.go

    }
    
    func getMajorMinor(path string) (string, error) {
    	var stat syscall.Stat_t
    	if err := syscall.Stat(path, &stat); err != nil {
    		return "", fmt.Errorf("unable to stat `%s`: %w", path, err)
    	}
    
    	devID := uint64(stat.Dev)
    	major := (devID & 0x00000000000fff00) >> 8
    	major |= (devID & 0xfffff00000000000) >> 32
    	minor := (devID & 0x00000000000000ff) >> 0
    	minor |= (devID & 0x00000ffffff00000) >> 12
    
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Thu Jan 18 07:03:17 GMT 2024
    - 5.4K bytes
    - Viewed (0)
  4. docs/debugging/xl-meta/main.go

    		}
    		if len(files) > 1 || strings.HasSuffix(files[0], ".zip") {
    			ndjson = true
    		}
    
    		toPrint := make([]string, 0, 16)
    		for _, file := range files {
    			var r io.Reader
    			var sz int64
    			switch file {
    			case "-":
    				r = os.Stdin
    			default:
    				f, err := os.Open(file)
    				if err != nil {
    					return err
    				}
    				if st, err := f.Stat(); err == nil {
    					sz = st.Size()
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Wed Apr 24 17:56:22 GMT 2024
    - 20.2K bytes
    - Viewed (1)
  5. docs/debugging/healing-bin/main.go

    		if !c.Args().Present() {
    			cli.ShowAppHelpAndExit(c, 1) // last argument is exit code
    		}
    
    		ht := make(map[string]map[string]interface{})
    		file := c.Args().Get(0)
    		if strings.HasSuffix(file, ".zip") {
    			var sz int64
    			f, err := os.Open(file)
    			if err != nil {
    				return err
    			}
    			if st, err := f.Stat(); err == nil {
    				sz = st.Size()
    			}
    			defer f.Close()
    			zr, err := zip.NewReader(f, sz)
    			if err != nil {
    Go
    - Registered: Sun Apr 28 19:28:10 GMT 2024
    - Last Modified: Mon Sep 19 18:05:16 GMT 2022
    - 3.2K bytes
    - Viewed (0)
Back to top