Returns the audio file name of a given hash. Is no key as second parameter given, it
 trys first "mp3", than "m4a" and than it will return a more or less random
 value.

   {{ post.audio | audio:"m4a" }} => "my-episode.m4a"
765318
def audio(hsh, key = nil)
      if !hsh.nil? && hsh.length
        if key.nil?
          hsh['mp3'] ? hsh['mp3'] : hsh['m4a'] ? hsh['m4a'] : hsh['ogg'] ? hsh['ogg'] : hsh['opus'] ? hsh['opus'] : hsh.values.first
        else
          hsh[key]
        end
      end
    end
126948
async function getSubtitlesByHash (hash) {
  return request({
    method: 'GET',
    uri: SUBDB_API_URL,
    qs: {
      hash,
      action: 'download',
      language: 'en'
    },
    headers: {
      'User-Agent': 'SubDB/1.0 (subz-hero/0.1; https://github.com/BeLi4L/subz-hero)'
    }
  })
}
203855
function hashToString(hash) {
        var keyValuePairs = [];
        angular.forEach(hash, function (value, key) {
            keyValuePairs.push(key + "=" + value);
        });
        var params = keyValuePairs.join("&");
        return encodeURI(params);
    }
428478
function audioExt (name) {
  var ext = path.extname(name)
  return ['.wav', '.ogg', '.mp3'].indexOf(ext) > -1 ? ext : null
}
843164
protected String getFilename(HttpServletRequest request,
      HttpServletResponse response) throws IOException {
    final String filename = request.getParameter("filename");
    if (filename == null || filename.length() == 0) {
      throw new IOException("Invalid filename");
    }
    return filename;
  }
237657
def hash_name(name, script_pubkey, register_addr=None):
   
   bin_name = b40_to_bin(name)
   name_and_pubkey = bin_name + unhexlify(script_pubkey)
   
   if register_addr is not None:
       name_and_pubkey += str(register_addr)

   return hex_hash160(name_and_pubkey)
814060
def get_audio_metadata_old(fname):
    
    audio_dict = {}
    print("IDv2 tag info for %s:" % fname)
    try:
        audio = mutagenx.id3.ID3(fname, translate=False)
    except StandardError as err:
        print("ERROR = " + str(err))
    #else:
        #print(audio.pprint().encode("utf-8", "replace"))
        #for frame in audio.values():
        #    print(repr(frame))
    
    try:
        audio_dict["title"] = audio["title"]
    except KeyError:
        print("No title")
        
    try:
        audio_dict["artist"] = audio["artist"] # tags['TPE1'] 
    except KeyError:
        print("No artist")
        
    try:
        audio_dict["album"] = audio["album"]
    except KeyError:
        print("No album")
        
    try:
        audio_dict["length"] = audio["length"]
    except KeyError:
        print("No length")
        
    #pprint.pprint(audio.tags)
        
    return audio_dict
1226393
def filename
      return unless original_filename

      filename = if model.respond_to?("#{mounted_as}_filename")
                   model.send("#{mounted_as}_filename")
                 else
                   model.title.parameterize
                 end

      # Safe-guard against customized filename methods or parameterize returning an empty string
      return original_filename if filename.blank?

      "#{filename}.#{file.extension}"
    end
735581
function key() {
	var hashName = _.result( this, 'hashAttribute' ) || _.result( this, 'idAttribute' ),
		rangeNake = _.result( this, 'rangeAttribute' );

	return this.pick( hashName, rangeNake );
}
805675
public static String getFileNameOrUuid(TaskResponse response) {
        String name = getFileName(response);
        if (null == name) {
            name = UUID.randomUUID().toString();
        }
        return name;
    }
1006080
function randomFileOrFolderName(len = 32) {
  if (Number.isFinite(len)) {
    return crypto.randomBytes(Math.ceil(len / 2)).toString('hex').slice(0, len);
  }
  throw new Error(`illegal argument: ${len}`);
}
1113684
def get_filename(self, stream, media_type, parser_context):
        
        try:
            return parser_context['kwargs']['filename']
        except KeyError:
            pass

        try:
            meta = parser_context['request'].META
            disposition = parse_header(meta['HTTP_CONTENT_DISPOSITION'].encode('utf-8'))
            filename_parm = disposition[1]
            if 'filename*' in filename_parm:
                return self.get_encoded_filename(filename_parm)
            return force_text(filename_parm['filename'])
        except (AttributeError, KeyError, ValueError):
            pass
657530
public static String parseNonceFromHashinatorConfigFilename(String filename) {
        if (filename == null || !filename.endsWith(HASH_EXTENSION)) {
            throw new IllegalArgumentException("Bad hashinator config filename: " + filename);
        }

        return parseNonceFromSnapshotFilename(filename);
    }
874270
private String getFileName(String fileName) {

        if (fileName != null) {
            int index = fileName.indexOf(':');
            if (index < 0) {
                return fileName;
            } else {

                fileName = fileName.substring(index + 1);

                index = fileName.lastIndexOf('/');
                if (index < 0) {
                    return fileName;
                } else {
                    return fileName.substring(index + 1);
                }

            }
        }
        return null;
    }
612964
@NonNull
    private static String randomMediaPath(File bucket, String extension) {
        if (bucket.exists() && bucket.isFile()) bucket.delete();
        if (!bucket.exists()) bucket.mkdirs();
        String outFilePath = AlbumUtils.getNowDateTime("yyyyMMdd_HHmmssSSS") + "_" + getMD5ForString(UUID.randomUUID().toString()) + extension;
        File file = new File(bucket, outFilePath);
        return file.getAbsolutePath();
    }
521584
def filename_for_track(track):
    
    artist = track.user['permalink']
    title = track.title

    return '{}-{}.mp3'.format(artist, title).lower().replace(' ', '_').replace('/', '_')
145506
function( response, fileType ) {
        var fs = require( 'fs' ),
            mime = require( 'mime' ),
            audioOption = this.getValidAudioOption(),
            audioFileName = audioOption ? audioOption.path : '',// If there's no audioOption, we set the file name as empty
            audioFilePath = __dirname + '/audios/' + audioFileName,
            mimeType,
            stream;

        // If the file name is empty, we skip any work and return a 404 response
        if ( audioFileName ) {
            // We need to replace '.mp3' with '.ogg' if the fileType === 'ogg'
            if ( fileType === 'ogg' ) {
                audioFileName = audioFileName.replace( /\.mp3/gi, '.ogg' );
                audioFilePath = audioFilePath.replace( /\.mp3/gi, '.ogg' );
            } else {
                fileType = 'mp3';// This isn't doing anything, really, but I feel better with it
            }

            fs.exists( audioFilePath, function( exists ) {
                if ( exists ) {
                    mimeType = mime.getType( audioFilePath );

                    // Set the appropriate mime type
                    response.set( 'content-type', mimeType );

                    // Make sure this is not cached
                    response.set( 'cache-control', 'no-cache, no-store, must-revalidate' );
                    response.set( 'pragma', 'no-cache' );
                    response.set( 'expires', 0 );

                    stream = fs.createReadStream( audioFilePath );
                    var responseData = [];

                    if ( stream ) {
                        stream.on( 'data', function( chunk ) {
                          responseData.push( chunk );
                        });

                        stream.on( 'end', function() {
                            if ( ! response.headerSent ) {
                                var finalData = Buffer.concat( responseData );
                                response.write( finalData );

                                // Add some noise randomly, so audio files can't be saved and matched easily by filesize or checksum
                                var noiseData = crypto.randomBytes(Math.round((Math.random() * 1999)) + 501).toString('hex');
                                response.write( noiseData );

                                response.end();
                            }
                        });
                    } else {
                        response.status( 404 ).send( 'Not Found' );
                    }
                } else {
                    response.status( 404 ).send( 'Not Found' );
                }
            });
        } else {
            response.status( 404 ).send( 'Not Found' );
        }
    }